package com.towker.core.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 获取ApplicationContext
 * 调用方法 SpringContextUtil.getContext();
 * @author Administrator
 *
 */
public class SpringContextUtil implements ApplicationContextAware {

	private static  ApplicationContext context;

	//声明一个静态变量保存

	public void setApplicationContext(ApplicationContext contex) throws BeansException {
		context=contex;
	}

	public static ApplicationContext getContext(){
		return context;
	}



}
